package com.hscm.boss.convert;

import com.hscm.boss.convert.help.CommonFun;
import com.hscm.boss.dao.entity.*;
import com.hscm.boss.mvc.model.vo.config.UserPayConfigVo;
import com.hscm.boss.mvc.model.vo.config.UserPayInfoVo;
import com.hscm.boss.mvc.model.vo.product.MatchPayProductVo;
import com.hscm.boss.mvc.model.vo.product.PayProductVo;
import com.hscm.boss.mvc.model.vo.user.UserInfoVo;
import com.hscm.boss.mvc.model.vo.way.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.Named;

import java.util.List;

@Mapper(componentModel = "spring",uses = {CommonFun.class})
public interface PaymentConvert {

    List<PayProductVo> toListPayProductVo(List<PayProduct> payProductList);

    List<PayWayVo> toListPayWayVo(List<PayWay> payWayList);
    List<UserPayConfigVo> toListUserPayConfigVo(List<UserPayConfig> userPayConfigList);

    List<MatchPayProductVo> toListMatchPayProductVo(List<PayProduct> payProductList);




    @Mappings({
            @Mapping(source = "status", target = "status",qualifiedByName = "transPublicStatus"),
            @Mapping(source = "editTime", target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:ss")

    })
    PayProductVo mapProductVo(PayProduct payProduct);

    @Mappings({
            @Mapping(source = "status", target = "status",qualifiedByName = "transPublicStatus"),
            @Mapping(source = "editTime", target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "payProductCode", target = "productCode")

    })
    PayWayVo toPatWayVo(PayWay payWay);


    @Mappings({
            @Mapping(source = "editTime", target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "autoSett", target = "autoSett",qualifiedByName = "transAutoSett"),
            @Mapping(source = "payProductCode", target = "productCode"),
            @Mapping(source = "payProductName", target = "productName")

    })
    UserPayConfigVo userPayConfigVo(UserPayConfig userPayConfig);



    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "productCode", target = "productCode"),
            @Mapping(source = "productName", target = "productName")
    })
    MatchPayProductVo matchPayProductVo(PayProduct PayProduct);


}
